
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>zsh安装手册 · 加解密常见问题</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="华夏银行综合支付项目组">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="navicat安装.html" />
    
    
    <link rel="prev" href="gitbook.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="gitbook.html">
            
                <a href="gitbook.html">
            
                    
                    gitbook
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="oh-my-zsh.html">
            
                <a href="oh-my-zsh.html">
            
                    
                    zsh安装手册
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="navicat安装.html">
            
                <a href="navicat安装.html">
            
                    
                    linux下安装navicat
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >zsh安装手册</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x5B89;&#x88C5;zsh">&#x5B89;&#x88C5;zsh</h2>
<p>&#x67E5;&#x770B;&#x7CFB;&#x7EDF;&#x5F53;&#x524D;&#x4F7F;&#x7528;&#x7684;shell</p>
<pre class="language-"><code>$ echo $SHELL 
/bin/bash
</code></pre><p>&#x67E5;&#x770B;&#x7CFB;&#x7EDF;&#x662F;&#x5426;&#x5B89;&#x88C5;&#x4E86;zsh</p>
<pre class="language-"><code class="lang-bash">$ <span class="token function">cat</span> /etc/shells
</code></pre>
<p>centos7&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#x6CA1;&#x5B89;&#x88C5;zsh</p>
<p>&#x7528;yum&#x5B89;&#x88C5;zsh</p>
<pre class="language-"><code>$ yum -y install zsh
</code></pre><p>&#x67E5;&#x770B;shell&#x5217;&#x8868;</p>
<pre class="language-"><code>$ cat /etc/shells 
/bin/zsh
</code></pre><p>&#x5207;&#x6362;shell&#x4E3A;zsh</p>
<pre class="language-"><code>$ chsh -s /bin/zsh
Changing shell for root.
Shell changed.
</code></pre><p>&#x91CD;&#x542F;&#x670D;&#x52A1;&#x5668;&#x540E;&#xFF0C;&#x53EF;&#x4F7F;&#x7528;<code>reboot</code></p>
<p>&#x91CD;&#x542F;&#x540E;&#xFF0C;&#x67E5;&#x770B;&#x5F53;&#x524D;shell</p>
<pre class="language-"><code>$ echo $SHELL 
/bin/zsh
</code></pre><h2 id="&#x5B89;&#x88C5;-oh-my-zsh">&#x5B89;&#x88C5; oh my zsh</h2>
<p>oh-my-zsh&#x6E90;&#x7801;&#x662F;&#x653E;&#x5728;github&#x4E0A;&#xFF0C;&#x5148;&#x786E;&#x4FDD;&#x4F60;&#x7684;&#x673A;&#x5668;&#x4E0A;&#x5DF2;&#x5B89;&#x88C5;&#x4E86;git</p>
<p>&#x5B89;&#x88C5;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">sh</span> -c <span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">curl</span> -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh<span class="token variable">)</span></span>&quot;</span>
</code></pre>
<h2 id="&#x5B98;&#x65B9;github">&#x5B98;&#x65B9;github</h2>
<p><a href="https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins" target="_blank">https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins</a></p>
<h2 id="z&#x8DF3;&#x8F6C;&#x63D2;&#x4EF6;&#xFF08;&#x63A8;&#x8350;&#xFF09;">z&#x8DF3;&#x8F6C;&#x63D2;&#x4EF6;&#xFF08;&#x63A8;&#x8350;&#xFF09;</h2>
<p>git@gitee.com:mirrors/z.lua.git</p>
<p>&#x5728; <code>.zshrc</code> &#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x52A0;&#x5165;&#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x5E76;&#x66F4;&#x65B0; <code>.zshrc</code> &#x6587;&#x4EF6;&#x3002;</p>
<pre class="language-"><code>eval &quot;$(lua ~/.soft/z/z.lua --init zsh)&quot;
</code></pre><pre class="language-"><code class="lang-text"> z foo       # &#x8DF3;&#x8F6C;&#x5230;&#x5305;&#x542B; foo &#x5E76;&#x4E14;&#x6743;&#x91CD;&#xFF08;Frecent&#xFF09;&#x6700;&#x9AD8;&#x7684;&#x8DEF;&#x5F84;
 z foo bar   # &#x8DF3;&#x8F6C;&#x5230;&#x540C;&#x65F6;&#x5305;&#x542B; foo &#x548C; bar &#x5E76;&#x4E14;&#x6743;&#x91CD;&#x6700;&#x9AD8;&#x7684;&#x8DEF;&#x5F84;
 z -r foo    # &#x8DF3;&#x8F6C;&#x5230;&#x5305;&#x542B; foo &#x5E76;&#x4E14;&#x8BBF;&#x95EE;&#x6B21;&#x6570;&#x6700;&#x9AD8;&#x7684;&#x8DEF;&#x5F84;
 z -t foo    # &#x8DF3;&#x8F6C;&#x5230;&#x5305;&#x542B; foo &#x5E76;&#x4E14;&#x6700;&#x8FD1;&#x8BBF;&#x95EE;&#x8FC7;&#x7684;&#x8DEF;&#x5F84;
 z -l foo    # &#x4E0D;&#x8DF3;&#x8F6C;&#xFF0C;&#x53EA;&#x662F;&#x5217;&#x51FA;&#x6240;&#x6709;&#x5339;&#x914D; foo &#x7684;&#x8DEF;&#x5F84;
 z -c foo    # &#x8DF3;&#x8F6C;&#x5230;&#x5305;&#x542B; foo &#x5E76;&#x4E14;&#x662F;&#x5F53;&#x524D;&#x8DEF;&#x5F84;&#x7684;&#x5B50;&#x8DEF;&#x5F84;&#x7684;&#x6743;&#x91CD;&#x6700;&#x9AD8;&#x7684;&#x8DEF;&#x5F84;
 z -e foo    # &#x4E0D;&#x8DF3;&#x8F6C;&#xFF0C;&#x53EA;&#x662F;&#x6253;&#x5370;&#x51FA;&#x5339;&#x914D; foo &#x5E76;&#x4E14;&#x6743;&#x91CD;&#x6700;&#x9AD8;&#x7684;&#x8DEF;&#x5F84;
 z -i foo    # &#x8FDB;&#x5165;&#x4EA4;&#x4E92;&#x5F0F;&#x9009;&#x62E9;&#x6A21;&#x5F0F;&#xFF0C;&#x8BA9;&#x4F60;&#x81EA;&#x5DF1;&#x6311;&#x9009;&#x53BB;&#x54EA;&#x91CC;&#xFF08;&#x591A;&#x4E2A;&#x7ED3;&#x679C;&#x7684;&#x8BDD;&#xFF09;
 z -I foo    # &#x8FDB;&#x5165;&#x4EA4;&#x4E92;&#x5F0F;&#x9009;&#x62E9;&#x6A21;&#x5F0F;&#xFF0C;&#x4F46;&#x662F;&#x4F7F;&#x7528; fzf &#x6765;&#x9009;&#x62E9;
 z -b foo    # &#x8DF3;&#x8F6C;&#x5230;&#x7236;&#x76EE;&#x5F55;&#x4E2D;&#x540D;&#x79F0;&#x4EE5; foo &#x5F00;&#x5934;&#x7684;&#x90A3;&#x4E00;&#x7EA7;
</code></pre>
<p>&#x901A;&#x8FC7;&#x8BBE;&#x7F6E;&#x522B;&#x540D;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x6253;&#x51FA;&#x7684;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x9009;&#x9879;&#xFF0C;&#x6BD4;&#x5982;</p>
<pre class="language-"><code class="lang-text"> alias zc=&apos;z -c&apos;      # &#x4E25;&#x683C;&#x5339;&#x914D;&#x5F53;&#x524D;&#x8DEF;&#x5F84;&#x7684;&#x5B50;&#x8DEF;&#x5F84;
 alias zz=&apos;z -i&apos;      # &#x4F7F;&#x7528;&#x4EA4;&#x4E92;&#x5F0F;&#x9009;&#x62E9;&#x6A21;&#x5F0F;
</code></pre>
<p>&#x642D;&#x914D; fzf &#x4F7F;&#x7528; &#x66F4;&#x4F73;&#x54E6;</p>
<pre class="language-"><code class="lang-text"> # &#x642D;&#x914D; fzf &#x8FDB;&#x884C;&#x5386;&#x53F2;&#x8DEF;&#x5F84;&#x6A21;&#x7CCA;&#x5339;&#x914D;:
 alias zf=&apos;cd &quot;$(z -l -s | fzf --reverse --height 35%)&quot;&apos;
</code></pre>
<h2 id="incrzsh-&#x8865;&#x5168;&#x63D2;&#x4EF6;&#x5F3A;&#x70C8;&#x63A8;&#x8350;"><a href="http://mimosa-pudica.net/zsh-incremental.html" target="_blank">incr.zsh &#x8865;&#x5168;&#x63D2;&#x4EF6;</a>(&#x5F3A;&#x70C8;&#x63A8;&#x8350;)</h2>
<pre class="language-"><code class="lang-shell"><span class="token function">mkdir</span> -p ~/.oh-my-zsh/custom/plugins/incr <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">cd</span>  ~/.oh-my-zsh/custom/plugins/incr  <span class="token operator">&amp;&amp;</span>  <span class="token function">wget</span> http://mimosa-pudica.net/src/incr-0.2.zsh
</code></pre>
<p>&#x5728;<code>~/.zshrc</code>&#x6587;&#x4EF6;&#x672B;&#x5C3E;&#x52A0;&#x4E0A;&#x5E76;&#x66F4;&#x65B0;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash"><span class="token builtin class-name">echo</span> <span class="token string">&quot;source ~/.oh-my-zsh/plugins/incr/incr-0.2.zsh&quot;</span> <span class="token operator">&gt;&gt;</span> ~/.zshrc <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">source</span> ~/.zshrc
</code></pre>
<h2 id="zplug&#x5B89;&#x88C5;">zplug&#x5B89;&#x88C5;</h2>
<pre class="language-"><code>curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
</code></pre><h2 id="zsh-syntax-highlighting&#xFF08;&#x63A8;&#x8350;&#xFF09;">zsh-syntax-highlighting&#xFF08;&#x63A8;&#x8350;&#xFF09;</h2>
<pre class="language-"><code class="lang-bash"><span class="token function">git</span> clone https://github.com/zsh-users/zsh-syntax-highlighting.git <span class="token variable">$ZSH_CUSTOM</span>/plugins/zsh-syntax-highlighting
</code></pre>
<h2 id="zsh-autosuggestions&#x63A8;&#x8350;">zsh-autosuggestions(&#x63A8;&#x8350;)</h2>
<p>&#x514B;&#x9686;&#x9879;&#x76EE;</p>
<pre class="language-"><code class="lang-shell"><span class="token function">git</span> clone git://github.com/zsh-users/zsh-autosuggestions <span class="token variable">$ZSH_CUSTOM</span>/plugins/zsh-autosuggestions

<span class="token comment"># suggest&#x7C98;&#x8D34;&#x8FDF;&#x949D;</span>
<span class="token function-name function">pasteinit</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token assign-left variable">OLD_SELF_INSERT</span><span class="token operator">=</span><span class="token variable">${${(s.<span class="token operator">:</span>.)widgets<span class="token punctuation">[</span>self-insert<span class="token punctuation">]</span>}</span><span class="token punctuation">[</span><span class="token number">2,3</span><span class="token punctuation">]</span><span class="token punctuation">}</span>
  zle -N self-insert url-quote-magic <span class="token comment"># I wonder if you&apos;d need `.url-quote-magic`?</span>
<span class="token punctuation">}</span>

<span class="token function-name function">pastefinish</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  zle -N self-insert <span class="token variable">$OLD_SELF_INSERT</span>
<span class="token punctuation">}</span>
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
</code></pre>
<footer class="page-footer"><span class="copyright">&#x5317;&#x4EAC;&#x5F00;&#x79D1;&#x552F;&#x8BC6;&#x516C;&#x53F8;&#x7248;&#x6743;&#x6240;&#x6709; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x7AE0;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-11-02 12:35:25
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="gitbook.html" class="navigation navigation-prev " aria-label="Previous page: gitbook">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="navicat安装.html" class="navigation navigation-next " aria-label="Next page: linux下安装navicat">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"zsh安装手册","level":"1.3","depth":1,"next":{"title":"linux下安装navicat","level":"1.4","depth":1,"path":"data/navicat安装.md","ref":"data/navicat安装.md","articles":[]},"previous":{"title":"gitbook","level":"1.2","depth":1,"path":"data/gitbook.md","ref":"data/gitbook.md","articles":[]},"dir":"ltr"},"config":{"plugins":["hide-element","back-to-top-button","prism","copy-code-button","chapter-fold","code","expandable-chapters","expandable-chapters-small","splitter","custom-favicon","insert-logo","tbfed-pagefooter","-sharing","sharing-plus"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"北京开科唯识公司版权所有","modify_label":"该文章修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"prism":{},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"./images/favicon.ico","back-to-top-button":{},"custom-favicon":{},"expandable-chapters-small":{},"copy-code-button":{},"sharing":{"twitter":false,"facebook":false,"google":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"insert-logo":{"style":"background: none; max-height: 60px; min-height: 50px","url":"./images/logo.png"},"expandable-chapters":{}},"theme":"default","author":"华夏银行综合支付项目组","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"加解密常见问题","language":"zh-hans","gitbook":"*","description":"常见问题汇总以及解决方法"},"file":{"path":"data/oh-my-zsh.md","mtime":"2020-11-02T04:35:25.859Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-12-03T05:09:32.854Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

